package com.education.welco.mapper;

import com.education.welco.pojo.PlatResourceShare;
import com.education.welco.pojo.PlatformResources;
import com.education.welco.pojo.vo.ShareSchoolVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 平台资源共享 持久层
 *
 * @Author: liftsail
 * @Date: 2022-09-28
 * @Description: 不积跬步无以至千里
 */
@Mapper
public interface PlatResourceShareMapper {

    /**
     * 查询平台资源共享信息
     *
     * @param id 平台资源共享ID
     * @return 平台资源共享信息
     */
    public PlatResourceShare selectPlatResourceShareById(Integer id);

    /**
     * 查询平台资源共享列表
     *
     * @param platResourceShare 平台资源共享信息
     * @return 平台资源共享集合
     */
    public List<PlatResourceShare> selectPlatResourceShareList(PlatResourceShare platResourceShare);

    /**
     * 新增平台资源共享
     *
     * @param platResourceShare 平台资源共享信息
     * @return 结果
     */
    public int insertPlatResourceShare(PlatResourceShare platResourceShare);

    /**
     * 修改平台资源共享
     *
     * @param platResourceShare 平台资源共享信息
     * @return 结果
     */
    public int updatePlatResourceShare(PlatResourceShare platResourceShare);

    /**
     * 删除平台资源共享
     *
     * @param id 平台资源共享ID
     * @return 结果
     */
    public int deletePlatResourceShareById(Integer id);

    /**
     * 批量删除平台资源共享
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deletePlatResourceShareByIds(String[] ids);

    List<ShareSchoolVo> selectShareSchoolList();

    PlatResourceShare selectPlatResourceShareByShareIdAndResIdAndReceiveId(@Param("sharerId") Integer sharerId, @Param("resId") String resId, @Param("receiverId") Integer receiverId);

    int updatePlatResourceShareByShareIdAndResIdAndReceiveId(PlatResourceShare platResourceSharecp);

    List<PlatResourceShare> selectPlatResourceShareByResIdAndisDelete(@Param("resIdList") List<String> resIdList, @Param("isDelete") boolean isDelete);

    List<PlatResourceShare> selectPlatResourceShareByShareIdAndResIdListAndReceiveId(@Param("sharerId") Integer sharerId, @Param("resIdList") List<String> resIdList, @Param("receiverId") Integer receiverId);

    int batchUpdatePlatResourceShareByShareIdAndResIdListAndReceiveId(@Param("sharerId") Integer sharerId, @Param("resIdListBefore") List<String> resIdListBefore, @Param("receiverId") Integer receiverId, @Param("isDelete") boolean isDelete);

    int batchInsertPlatResourceShareByShareIdAndResIdListAndReceiveId(@Param("sharerId") Integer sharerId, @Param("resIdListUserNow") List<String> resIdListUserNow, @Param("receiverId") Integer receiverId, @Param("isDelete") boolean isDelete);

    List<PlatformResources> listTheDirForShareListAndSchoolByUserId(@Param("sharerId") Integer sharerId);

    List<PlatformResources> selectShareSchoolResListBySchoolId(@Param("schoolId") Integer schoolId, @Param("teaId") Integer teaId);

    void deletePlatResourceShareByResId(String resId);
}